<template>
	<view class="course-item" :class="{ column: isColumn }"
		@click="navTo(`/pages/course/course-details?id=${item.id}`)">
		<view class="item-t">
			<image class="course-img" :src="item.showimg" lazy-load></image>
			
		</view>
		<view class="item-b column ">
			<view class="name">{{ item.t_nickname }}</view>
			<view class="jl">{{ item.experience }}年行业经验</view>
			<!-- <view @click="phone(item.phone)" class="wtbj">委托牵线</view> -->
			<view @click="orCode(item.QR_Code)" class="wtbj">委托牵线</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: true,
				or_code_img:'',

			};
		},
		props: {
			isColumn: {
				// 是否纵向排列图片和文字（true纵向，false则横向）
				type: Boolean,
				default: false
			},

			item: {
				type: Object,
				default: () => ({
					id: 1,
					mainImage: 'http://ydxcx.dianteng.cc/static/uploads/picture/20221102/60126129c4633581aa23288e0f38480a.png',
					totalTime: '00:59:38',
					title: 'uni-app梦学谷在线教育项目实战！',
					nickName: '梦学谷',
					isFree: 0, // 是否收费0收费，1免费
					priceOriginal: 999, // 原价
					priceDiscount: 599, // 优惠价
					studyTotal: 399
				})
			}
		},

		methods: {
			phone(phnum) {
				uni.makePhoneCall({
					phoneNumber: phnum
				});
			},
			orCode(QR_Code) {
				
				this.$emit('fatherMethod',QR_Code);
				
				
				
			}
		}
	};
</script>

<style scoped lang="scss">
	.course-item {
		margin-top: 20rpx;
		width: 268rpx;
		height: 468rpx;
		// background: #bae;
		background: #ffffff;
		border-radius: 18rpx;
	}

	.course-img {
		width: 210rpx;
		height: 240rpx;
		// background: #FFFFFF;
		border-radius: 20rpx 20rpx 0rpx 0rpx;
	}

	.item-b {
		width: 210rpx;
		// background: red;
		text-align: center;
		// border-style: dotted;
		display: flex;

		align-items: center;
	}

	.name {
		// width: 194rpx;
		// height: 27rpx;
		margin-top: 20rpx;
		font-size: 28rpx;
		font-family: PingFang;
		font-weight: bold;
		color: #010101;
		align-items: center;
		// line-height: 70rpx;
	}

	.jl {
		margin-top: 10rpx;
		font-size: 20rpx;
		font-family: PingFang;
		font-weight: bold;
		color: #999999;

		// align-items: center;
		// line-height: 70rpx;
	}

	.wtbj {
		margin-top: 10rpx;
		text-align: center;
		width: 184rpx;
		height: 42rpx;
		background: linear-gradient(90deg, #ff0000, #ffbb96);
		border-radius: 21rpx;
		line-height: 42rpx;

		font-size: 22rpx;
		font-family: PingFang;
		font-weight: bold;
		color: #ffffff;
	}
</style>